package com.eco.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
/* loaded from: newfishway-1.0.0-SNAPSHOT.jar:BOOT-INF/classes/com/eco/controller/WsCameraController.class */
public class WsCameraController {
    private static final Logger log = LoggerFactory.getLogger((Class<?>) WsCameraController.class);

    @Value("${station.camera.names}")
    private String[] cameraNames;

    @Value("${station.camera.hls-url}")
    private String[] cameraUrls;

    @Value("${station.wsUrl}")
    private String wsUrl;
    private static final String ON_FULLIN_LAMP = "00 00 00 00 00 06 FF 05 00 64 FF 00";
    private static final String OFF_FULLIN_LAMP = "00 00 00 00 00 06 FF 05 00 64 00 00";
    private static final String ON_FISH_LAMP = "00 00 00 00 00 06 FF 05 00 66 FF 00";
    private static final String OFF_FISH_LAMP = "00 00 00 00 00 06 FF 05 00 66 00 00";

    @GetMapping({"/getCameraAndWS"})
    public JSONObject getCameraAndWS() {
        JSONObject jSONObject = new JSONObject();
        JSONArray datas = new JSONArray();
        for (int i = 0; i < this.cameraNames.length; i++) {
            JSONObject data = new JSONObject();
            data.put("hlsName", (Object) this.cameraNames[i]);
            data.put("hlsUrl", (Object) this.cameraUrls[i]);
            datas.add(data);
        }
        jSONObject.put("camera", (Object) datas);
        jSONObject.put("wsUrl", (Object) this.wsUrl);
        return jSONObject;
    }
}